﻿Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms

Imports ACSeguridad

Public Class GetSetMenu

#Region "Variables"
   Private x As ACDataConexion
   Private y As ACDataUsuario
#End Region

#Region "Contructores"
   Public Sub New()
      InitializeComponent()

      txtUser.Text = "YSAACX"
      x = New ACDataConexion()
      y = New ACDataUsuario()

      x.BaseDatos = "ACADMIN"
      x.Servidor = "192.168.30.5\SQL8"
      x.UsuarioBD = "sa"
      x.PasswordBD = "varserv123"
      x.Algoritmo = "002"

      y.APLI_Codigo = "TRA"
      y.EMPR_Codigo = "JRANC"
      y.PROC_Codigo = "MENU"

      txtEmpresa.Text = y.EMPR_Codigo
      txtAplicacion.Text = y.APLI_Codigo
      txtProceso.Text = y.PROC_Codigo
      txtBaseDatos.Text = x.BaseDatos
      txtAlgoritmo.Text = x.Algoritmo
      txtUsuarioSQL.Text = x.UsuarioBD
      txtServidor.Text = x.Servidor

      txtPasswordSQL.Text = x.PasswordBD
   End Sub

   Private Sub getConfig()
      x.BaseDatos = txtBaseDatos.Text
      x.Servidor = txtServidor.Text
      x.UsuarioBD = txtUsuarioSQL.Text
      x.PasswordBD = txtPasswordSQL.Text
      x.Algoritmo = txtAlgoritmo.Text

      y.APLI_Codigo = txtAplicacion.Text
      y.EMPR_Codigo = txtEmpresa.Text
      y.PROC_Codigo = txtProceso.Text

   End Sub
#End Region


   Private Sub button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button2.Click
      ACGenerarMenu.setMenuDisabled(mnuPrincipal)
   End Sub

   Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button1.Click
      y.USER_CodUsr = txtUser.Text.Trim()
      y.USER_PassUsr = txtPassword.Text.Trim()
      getConfig()
      y.USER_PassUsr = txtPassword.Text.Trim()

      y.USER_IdUser = 5
      Dim v As New ACGenerarMenu(x, y, mnuPrincipal, ACTypeQueryMenu.asignarMenu, "yyyy/MM/dd")
   End Sub

   Private Sub button3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button3.Click
      ACGenerarMenu.setMenuEnabled(mnuPrincipal)
   End Sub

   Private Sub button4_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button4.Click
      ACGenerarMenu.setMenuEnabledItems(mnuPrincipal)
   End Sub

   Private Sub button5_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button5.Click
      ACGenerarMenu.setMenuDisabledItems(mnuPrincipal)
   End Sub

   Private Sub button6_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button6.Click
      ACGenerarMenu.setMenuVisibleItems(mnuPrincipal, True)
   End Sub

   Private Sub button7_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button7.Click
      ACGenerarMenu.setMenuVisibleItems(mnuPrincipal, False)
   End Sub

   Private Sub button8_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button8.Click
      y.USER_CodUsr = txtUser.Text.Trim()
      y.USER_PassUsr = txtPassword.Text.Trim()

      y.USER_PassUsr = txtPassword.Text.Trim()
      getConfig()
      'Dim v As New ACGenerarMenu(x, y, menuCobex, ACTypeQueryMenu.generarMenu)
      MessageBox.Show("Generado Satisfactoriamente")
      'NSDialogos.MostrarMensajeSatisfactorio("Información: " + this.Text, "Generado Satisfactoriamente");
   End Sub

   Private Sub btnAceptar_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAceptar.Click

   End Sub

End Class